package com.bite.deom3;

public class Student implements Comparable {

    String name;
    String classroom;
    int age;
    int scroce;

    public Student(String name, String classroom, int age, int scroce) {
        this.name = name;
        this.classroom = classroom;
        this.age = age;
        this.scroce = scroce;
    }

    public Student() {}

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getClassroom() {
        return classroom;
    }

    public void setClassroom(String classroom) {
        this.classroom = classroom;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getScroce() {
        return scroce;
    }

    public void setScroce(int scroce) {
        this.scroce = scroce;
    }

    public String toString() {
        return getName()+" "+getAge()+" "+getClassroom()+" "+getScroce();
    }

    public int compareTo(Object o) {
        Student student = (Student) o;
     return this.getAge() - ((Student) o).getAge();
    }

}
